\f0\b0\fs32 A contour plotting program on the NeXT which attempts to emulate PLOT3D \
( Pieter Buning's plotting package for Computational Fluid Dynamics).\
\b\fs36 Introduction:\
\b0\fs32 \
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc1\cf1 NeXTcontour is intended for use in plotting contours of functions from either \
2D (two-dimensional) or 3D (three-dimensional) data sets. The program allows 2D or 3D data consisting of a grid file(a structured - single block set of coordinate lines) and a solution file (typically data from a CFD computation, but any number of 2D or 3D variables of data at the grid points is acceptable). The grid can be an arbitrary curvilinear coordinate system as long as the data is ordered in a lexicographical fashion. Various functions of the data can be plotted and subsets of the data can be chosen. In 3D, the grid and contour data can be viewed in computational space (uniform coordinate index space) or in a projection onto the base x-y, x-z or y-z constant planes. A simple min/max viewing capability exists along with a zooming function. Grid/contour line thickness, color and contour line styles are selectable. In 3D, animation of coordinate families is possible. Hardcopy output is handled either through the print panel or by selecting "save EPS file" (produces an encapsulated PostScript file).\
This program uses the standard NeXT type interface. \
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc1\cf1 New Features: (Aug. 91)\
Added services capability so that nxyplot (a line plotting package which can be obtained off the net , sonata.cc.purdue.edu : /pub/next/2.0-release/nxyplot1.6.tar.Z)\
can be used to plot line data set up using the Line Data panel.\
Added Line Data panel which allows user to subset to a coordinate line and plot the function data verses x,y,z,or arclength. See below.\
Added new function Cp (for aerodynamic users).\
Added simple color option for contours.\
Added preferences for user setting on startup. See description below.\
New Features: (Sept. 91)\
Modified data interface to read in either aerodynamic data (PLOT3D style) or general data with an arbitrary number of functions.\
Added Function title and modified contour level display.\
New Features: (Dec 91)\
Added formatted data read capability. (Note: there is no error checking when formatted data is read.) Added more error checking in the subsets interface. \
New Features: (Jan 92)\
Added List Data for formatted output of raw data in a text window. Put in print\
color option for default black/white printing and color setting. Added new \
preference items. \
New Features: (June 92)\
Fixed up and added animate grids.\
Fixes (July 1992)\
Fixed a memory malloc leak. Big time mistake (hope nobodys mad at me).\
\b0 (I use the data and solution interchangingly): \
Input grid/solution files are usually binary. Formatted reads are now available, but slow and big. For binary reads there is a fair amount of error checking used to compare the file sizes with expected sizes.
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc1\cf1 You must first read in a grid.
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc0\cf0 The program reads in the first line of integers which is the grid size and computes the expected binary file size and compares this with the file size on the system. If an error occurs the "
\b Alert Panel
\b0 " comes up and ask for a response. If the data file is wrong you can "
\b Abort
\b0 ", "
\b Continue
\b0 " at your own risk, or "
\b Try Again
\b0 " which brings one back to the Open File Panel. This same type of error checking is used for the data file with the additional information as to the number of functions being read and the type (Aerodynamic or general) of data read in (see
\b Control Panel
\b0 explanation of
\b number of functions read in
\b0 and the data types
\b Aerodynamic
\b0 or
\b General
\b0 ). Error checking is turned off for formatted reads.\
\b File formats:
\b0 \
\b\i
\b0\i0
\b 2D
\b0 : \
Grid::\
(int) jmax, kmax : index sizes of data\
for (i = 0; i < jmax*kmax; i++) (float)x[i] : x coordinate\
for (i = 0; i < jmax*kmax; i++) (float)y[i] : y coordinate\
for (i = 0; i < jmax*kmax*lmax; i++) (float)rho[i] : variable #1\
for (i = 0; i < jmax*kmax*lmax; i++) (float)rhou[i] : variable #2\
for (i = 0; i < jmax*kmax*lmax; i++) (float)rhov[i] : variable #3\
for (i = 0; i < jmax*kmax*lmax; i++) (float)rhow[i] : variable #4\
for (i = 0; i < jmax*kmax*lmax; i++) (float)e[i] : variable #5\
General Solution Data::\
(int) jmax, kmax,lmax : index sizes of data\
for (n=1; n<= number_of_functions_read_in; n++)\{\
for (i = 0; i < jmax*kmax*lmax; i++) (float)function[i] : variable #n\}\
The CFD variables rho (density), rhou (u- momentum), \
rhov (v- momentum), rhow (w- momentum in 3D) and e (energy)\
can be replace with any function on the grid. \
\b
\fs36 Control panel:\
\b0\fs32 \
\b Functions
\b0 : Up to 12 functions are possible. Modify the source code for more.\
For AeroDynamic Applications\
Density : Q1 -> rho (
\f2 r
\f0 ) or the first variable.
\i Default
\i0 .\
\f2
\f0 Q2 -> (
\f2 r
\f0 u) = rhou or the second variable\
\f2
\f0 Q3 -> (
\f2 r
\f0 v) = rhov or the third variable\
\f2
\f0 Q4 -> (
\f2 r
\f0 w) = rhow or the fourth variable (3D only)\
\f2
\f0 e : Q5 -> e = total energy or the fourth 2D (fifth 3D) variable\
Mach Number -> M = sqrt (u
\up12 2
\up0 + v
\up12 2
\up0 ) / sqrt (
\f2 g
\f0 p /
\f2 r)
\f0 2D or \
M = sqrt (u
\up12 2
\up0 + v
\up12 2
\up0 + w
\up12 2
\up0 ) / sqrt (
\f2 g
\f0 p /
\f2 r)
\f0 3D\
Pressure -> p = (
\f2 g - 1) (
\f0 e
\f2 - 0.5 r (
\f0 u
\up12 2
\up0 + v
\up12 2
\up0 ) ) 2D or \
p = (
\f2 g - 1) (
\f0 e
\f2 - 0.5 r (
\f0 u
\up12 2
\up0 + v
\up12 2
\up0 + w
\up12 2
\up0 ) ) 3D\
Cp -> Cp = 2 (
\f2 g
\f0 p - 1) / (
\f2 g
\f0 fsmach
\up12 2
\up0 )\
U- velocity -> u = (
\f2 r
\f0 u) /
\f2 r
\f0 \
V- velocity -> v = (
\f2 r
\f0 v) /
\f2 r
\f0 \
W- velocity -> w = (
\f2 r
\f0 w) /
\f2 r (3
\f0 D only
\f2 )\
\f0 Inactive\
\b0 For General Applications\
Only the
\b number_of_functions_read_in
\b0 are available on Functions Matrix\
\b Type In Box:
\b0 \
Number of Functions Read In : \
Specify the number of functions to be read in.\
Default for 2D Aero Data is 4.\
Default for 3D Aero Data is 5.\
The user can specify any number here. If the data is
\b Aerodynamic
\b0 \
an
\b Alert Panel
\b0 will appear if in 2D the number is not 4 and 3D the \
number is not 5. One can have the number of functions read in reset \
to the appropriate values or continue at your own risk.\
\i
\b Warning:
\b0 Be careful that this number agrees with your data file! Although the code is robust enough to read in less or more data then is available, a typical error response is garbage plots.
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc1\cf1 I cannot be responsible for possible infinite loop hangups if one violates the function count.
\b0 : Uses solid line style for positive levels and \
dashed for negative levels. \
\b Contour Line Thickness
\b0 : Slider for line thickness. Range 0 - 4.\
\
\b Contour Line Color:
\b0 Light Gray, Dark Gray and Black Contour Lines.\
Colors is allowed for color contours. The current \
map is crude. On Black/White systems color\
contours may look strange. Also Printing color \
contours may be disappointing.\
\b\i \
\b0\i0
\b\fs36 Subsets / Grid panel:
\fs32 \
\b0 The approach here is to view only two-dimensionally, even for 3D data.\
Think in terms of a local coordinate sysyem x and y. If in 2D mode the settings are fixed for jk planes and xy viewing transformation. In 3D mode, one needs to set the subset plane and viewing transformation. \
\b Grid Subsets
\b0 : Type in the grid subset values for viewing. Set \
the coordinate plane (family). The "min box" is the \
controlling entry. The "min" value for a \
particular plane subset fixes the displayed plane number.\
The "max" value is reset to the "min" value for that plane \
choice. A reset button available.\
The user may want to subset out data for various reasons.\
This action only applies to the grid.\
\b \
reset Grid Subsets
\b0 : resets for specific plane choice the indices\
Animate G 3D
\b0 : Sweeps through a subset of planes set in "Grid Subsets"\
From min to max by inc. One pass per "Plot".\
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\b\fc1\cf1 Function Subsets
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\b0\fc0\cf0 : Type in the function subset values \
for viewing. Set the coordinate plane (family). \
The "min" value for a particular plane\
subset fixes the displayed plane number.\
The "max" value is reset to the "min" value for that plane \
choice. Reset button available.\
The user may want to subset out data for various reasons.\
This only applies to the function for the \
contouring. That is, the view for the grid is independent of \
the view for the function.\
\b \
reset Function Subsets
\b0 : resets for specific plane choice the indices\
Animate F 3D
\b0 : Sweeps through a subset of planes set in "Function Subsets"\
From min to max by inc. One pass per "Plot".\
\b Note:
\b0 Animate only works for 3D and the function subsets and plane choice \
take precedence over grid values.\
\i0
\b Viewing Transformations:
\b0 Viewing can be in XY , XZ , YZ, YX, ZX, ZY \
projection or computational space (index \
coordinates). Choosing any of these resets the \
min/max and subsets. \
\b + / - ViewPoint :
\b0 Allows for viewing the projection from the positive or negitive \
side of the image. Positive side is defined as the + local \
z coordinate side of the image. Imagine a right handed \
local coordinate system, (x to the left to right and y pointing \
up) then z points out of the screen, therefore the positive \
viewpoint is the observer sitting at positive infinity in z.\
A negative viewpoint is looking from minus infinity in z.\
\b Reset All Data:
\b0 Resets all subsets and min/max boxes.\
\b Equate Subsets
\b0 : Sets Grid subsets choices and grid plane choice to function values and setting. This gets done automatically if one chooses Animate G and Animate F simultaneously.\
\b Function min/max:
\b0 The function being plotted min/max values.\
\b min/max:
\b0 The xmin, xmax, ymin, and ymax for the view. Based on current\
subsets, plane and projection with x and y the plotting coordinate \
system.\
\b Grid Line Thickness:
\b0 Slider for line thickness. Range 0 - 4.\
\
\b Grid Line Color:
\b0 Light Gray, Dark Gray and Black grid lines. A color box is \
available for color systems. If you select one of the radio \
button, that color gets placed into the color well for use.\
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\b0\fc1\cf1 You may want to take a coordinate line of data and plot the chosen function against x, y, z, or arc length. This panel allows you to choose the coordinate line as a j line, k line or in 3D an l line. As in the other subset panels the first entry in the unselected coordinates is used to specify the coordinate index. (Only one coordinate line at a time can be used.) \
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fc1\cf1 resets the local session configuration.
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 One can set the default preference on \
startup to be \
\
\b 2D
\b0 or
\b 3D
\b0 , \
\b Aerodynamics
\b0 or
\b general variables,
\b0 \
\b Binary
\b0 or
\b Ascii
\b0 format on reads
\b0 \
\b Color
\b0 or
\b Black/White
\b0 , \
\b Print Color
\b0 to either
\b Black on White
\b0 or
\b Color
\b0 ,and the \
\b number of functions to be read in
\b0 to some value. \
Using the
\b Set Defaults
\b0 button writes the current setting to the users defaults \
database and resets the current sessions switches and values.\
Use
\b dread
\b0 to check on the user defaults database settings.\
\b\fs36 Bugs:
\b0\fs32 \
There is a fair amount of error checking going on in this code. When an error \
is encountered an
\b Alert panel
\b0 appears which explains the problem or prompts \
you for a response. In some cases, (for example, trying to plot a grid before a \
grid is read in) the panel will tell you to read a grid. In other cases, (for \
example, reading a file which is not a grid or data file) the
\b Alert panel
\b0 lets you\
\b try again
\b0 (i.e. brings up open panel again),
\b continue
\b0 (i.e. go ahead and read anyway, but be careful), and
\b abort
\b0 the attempt.\
The number of bugs in any program is inversely proportional to some power of the number of lines in the code and at the same time proportional to the age of the programmer to some other power. What is left to the imagination is the values of the powers.\
\fs36 Disclaimers:\
\b0\fs32 \
This program was developed for my own use, I intend to support it (in my spare time). I cheerfully accept all bug reports and suggestions for improvements or enhancements. \
\fs48 Author
\fs32 :\
Tom Pulliam\
pulliam@rft29.nas.nasa.gov\
Finally, remember this is freeware and is intended for free dissemination.\
I do not accept any responsibility for its use, modification, or abuse. As with all free software, this is not guaranteed to be worth any more than what you pay for it. More to come later.\
pulliam@rft29.nas.nasa.gov or pulliam@nas.nasa.gov
NXCursor
NXibeam
Scroller
_doScroller:
@@@ffs
[10@]
Courier-Bold
Plotting
Aspect Ratio = 1
Variable Aspect Ratio
Previous View
Why The Beep?
[12@]
Function 1
Function 2
Function 3
Function 4
Function 5
Inactive
Functions
Full Screen
Original Screen Size
Preview
NXswitch
NXswitchH
Fine Tuning
Binary Data
Ascii Formatted
Clear Plot
Overlay Plot
Plot Grid
Plot Function
3D Grid
2D Grid
Load Line Data
Choose a coordinate (j,k,or,l) line and set the index of the line in the other directions. Click "Load Line Data" to write data to Pasteboard. Then choose "plot with nxyplot" from services.
nxyplot starts up automatically and plot data.
X Projection
Y Projection
Z Projection
Arc Length
Index
Absissa Coordinate
Line Subsets
[14@]
reset Line Subsets
j line
k line
l line
Contour Min
Contour Max
Contour Inc
Manual Contours
Automatic Levels
Manual Levels
All Solid Contours
Solid + / Dashed -
Colors
Contour Line Color
Contour Line Thickness
Contour Line Styles
Number of Contours
Auto Contours
MenuTemplate
*@*@ccc
submenuAction:
NXmenuArrow
open grid file
open data file
save EPS file
Copy Graphics
Paste
Delete
List Data
List Grid Data
List Solution Data
List Function Data
Color Options
Color Panel
Colors...
Line Data
Windows
Arrange in Front
Miniaturize Window
Main Window
Controls
Subsets
Levels
Close Window
Print...
Services
Info Panel...
Help...
Preferences...
Choose A Color
Foreground Color
Background Color
WindowTemplate
iiii***@s@
Contour Levels
Panel
Main Title
x-y labels
units label
Change Labels Font
Contour Values
Change Title Font
Function Title
Subsets / Grid
Accessories
Black on White
Print Color Settings
Black on White: for non-color printers.
Color: for color printers or gray scale imaging on a non-color printer